<template>
	<view class="content">
		<uni-list :border="false">
			<uni-list-item  :border="false" showArrow clickable title="昵称" :rightText="userInfoData.nickname" link
				to="/pages/my/nickname" />
			<uni-list-item  :border="false" showArrow clickable title="绑定QQ" :rightText="userInfoData.qq" link to="/pages/my/addQQ" />
			<uni-list-item  :border="false" showArrow clickable title="绑定常用TB" :rightText="userInfoData.taobao_id" link
				to="/pages/my/addTB" />
			<uni-list-item  :border="false" showArrow clickable title="绑定备用TB" :rightText="userInfoData.taobao_id" link
				to="/pages/my/addTB" />
			<uni-list-item  :border="false" showArrow clickable title="小程序ID" :rightText="userInfoData.user_hash" />
			<uni-list-item  :border="false" showArrow clickable title="隐私政策" link to="/pages/my/policiesAndAgreements?type=1" />
			<uni-list-item  :border="false" showArrow clickable title="用户协议" link to="/pages/my/policiesAndAgreements?type=2" />
			<uni-list-item  :border="false" showArrow clickable title="切换账号" link to="/pages/my/switchAccounts" />
			<uni-list-item  :border="false" title="跳过扭蛋动画" @click="switchFn" clickable>
				<template v-slot:footer>
					<uni-icons :size="24" class="uni-icon-switch" color="#F6ADB5"
						:type="switchData?'checkbox-filled':'circle'" />
				</template>
			</uni-list-item>
			<!-- 			 -->
		</uni-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				switchData: false,
				userInfoData: {}
			}
		},
		onLoad() {
			// 是否跳过动画，前端缓存判断
			this.switchData = uni.getStorageSync('isSkip') || false;
		},
		async onShow() {
			await this.$onLaunched;
			this.getUserInfoFn()
		},
		// onShareAppMessage(res) {
		// 	return {
		// 		title: "给你分享了一份宝藏，快进来看看～",
		// 		path: '/pages/index/index',
		// 		imageUrl: '../../static/share.png'
		// 	};
		// },
		methods: {
			switchFn() {
				console.log(12111);
				this.switchData = !this.switchData;
				uni.setStorageSync('isSkip', this.switchData);
			},

			// 获取用户信息
			getUserInfoFn() {
				this.$http('/v1/auth/profile').then(res => {
					console.log(res, "获取用户信息");
					// uni.setStorageSync('userInfo', res.data);
					this.userInfoData = res.data;
				})
			},
		}
	}
</script>
<style>
	page {
		background-color: #FFF2F2;
	}
</style>
<style lang="scss" scoped>
	.content {
		padding: 24upx 22upx;

		::v-deep .uni-list {

		border-radius: 26upx;
		overflow: hidden;

			.uni-list-item {

				.uni-list-item__container {
					padding: 14upx 0 14upx 14upx;
.uni-list-item__content{
	    background: linear-gradient( 270deg, rgba(238,238,238,0) 0%, #FEDEDE 100%);
	    border-radius: 32rpx;
	    padding:8upx 0 8upx 30upx;
}
					.uni-list-item__content-title {
						font-size: 32upx;
						color: #454545;
						line-height: 48upx;
					}

					.uni-list-item__extra-text {

						font-weight: 400;
						font-size: 21upx;
						color: #969696;
						line-height: 31upx;
					}


				}

				.uni-list--border:after {
					height: 2upx;
					left: 34upx;
					background: #ECECEC;
					border-radius: 2upx;
				}

				.uni-icon-wrapper {
					padding-right: 50upx;

					.uni-icons {
						color: #969696 !important;
					}
				}

				.uni-icon-switch {
					padding-right: 94upx;
				}
			}
		}
	}
</style>